<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>小尚公益后台登录</title>
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="__PUBLIC__/admin/css/font.css">
	<link rel="stylesheet" href="__PUBLIC__/admin/css/xadmin.css">
    <link rel="stylesheet" href="https://cdn.bootcss.com/Swiper/3.4.2/css/swiper.min.css">
    <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <script type="text/javascript" src="https://cdn.bootcss.com/Swiper/3.4.2/js/swiper.jquery.min.js"></script>
    <script src="__PUBLIC__/admin/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="__PUBLIC__/admin/js/xadmin.js"></script>

</head>
<body>
    <div class="login-logo" style="padding-top: 150px;"><h1>小尚公益后台</h1></div>
    <div class="login-box" style="height: 310px;margin-top: 30px;width: 500px;">
        <form class="layui-form layui-form-pane" action="">
              
            <h3></h3>
            <label class="login-title" for="username">&nbsp;</label>
            <div class="layui-form-item" style="padding-left: 100px;">
                <label class="layui-form-label login-form"><i class="iconfont">&#xe6b8;</i></label>
                <div class="layui-input-inline login-inline">
                  <input type="text" name="username" lay-verify="required" placeholder="请输入你的帐号" autocomplete="off" class="layui-input" style="height: 39px;">
                </div>
            </div>
            <label class="login-title" for="password">&nbsp;</label>
            <div class="layui-form-item" style="padding-left: 100px;">
                <label class="layui-form-label login-form"><i class="iconfont">&#xe82b;</i></label>
                <div class="layui-input-inline login-inline">
                  <input type="password" name="password" lay-verify="required" placeholder="请输入你的密码" autocomplete="off" class="layui-input" style="height: 39px;">
                </div>
            </div>
            <div class="form-actions" style="margin-top: 30px;">
                <button class="btn btn-warning pull-right" lay-submit lay-filter="login"  type="submit">登录</button> 
                <!-- <div class="forgot"><a href="#" class="forgot">忘记帐号或者密码</a></div>  -->    
            </div>
        </form>
    </div>
	<div class="bg-changer">
        <div class="swiper-container changer-list">
            <div class="swiper-wrapper">
                <div class="swiper-slide"><img class="item" src="__PUBLIC__/admin/images/a.jpg" alt=""></div>
                <div class="swiper-slide"><img class="item" src="__PUBLIC__/admin/images/b.jpg" alt=""></div>
                <div class="swiper-slide"><img class="item" src="__PUBLIC__/admin/images/c.jpg" alt=""></div>
                <div class="swiper-slide"><img class="item" src="__PUBLIC__/admin/images/d.jpg" alt=""></div>
                <div class="swiper-slide"><img class="item" src="__PUBLIC__/admin/images/e.jpg" alt=""></div>
                <div class="swiper-slide"><img class="item" src="__PUBLIC__/admin/images/f.jpg" alt=""></div>
                <div class="swiper-slide"><img class="item" src="__PUBLIC__/admin/images/g.jpg" alt=""></div>
                <div class="swiper-slide"><img class="item" src="__PUBLIC__/admin/images/h.jpg" alt=""></div>
                <div class="swiper-slide"><img class="item" src="__PUBLIC__/admin/images/i.jpg" alt=""></div>
                <div class="swiper-slide"><img class="item" src="__PUBLIC__/admin/images/j.jpg" alt=""></div>
                <div class="swiper-slide"><img class="item" src="__PUBLIC__/admin/images/k.jpg" alt=""></div>
                <div class="swiper-slide"><span class="reset">初始化</span></div>
            </div>
        </div>
        <div class="bg-out"></div>
        <div id="changer-set"><i class="iconfont">&#xe696;</i></div>   
    </div>
    <script>
        $(function  () {
            layui.use('form', function(){
              var form = layui.form();
              //监听提交
                  form.on('submit(login)', function(data){
                    $.ajax({
                        url: "{:U('admin/login/login')}",//请求地址
                        type: "post",//请求方式
                        dataType: "json",//返回数据类型
                        data: data.field,//发送的参数
                        })
                        .done(function(response) {
                              if(response.error==0){
                                 layer.msg(response.info ,{icon:5});

                              }else{
                                 layer.msg(response.info ,{icon:6});
                                 location.href = response.url;
                              }
                          })
                        .fail(function() {
                            alert("ajxs交互失败");
                        }) 
                return false;
              });
            });
        })
        
    </script>
</body>
</html>